import { useRef, useState } from "react"

const UseRefDemo = () => {
    const [count, setCount] = useState(0)

    const counterEl = useRef(null)

    const increment = () => {
        console.log(counterEl.current.innerHTML = '这是使用useref')
        setCount(count + 1)
    }

    return (
        <>
            Count: {count}<span ref={counterEl}>这是span</span>
            <button onClick={increment}>Hooks点我+</button>
        </>
    )
}
export default UseRefDemo